/* ===== 基础重置 ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ===== 全局字体及背景 ===== */
body {
  font-family: Arial, sans-serif;
  background-color: #ecf0f1;
  color: #333;
}

/* ===== 顶部导航栏 ===== */
.top-nav {
  background-color: #34495e;
  color: white;
  height: 60px;
  line-height: 60px;
  display: flex;
  justify-content: space-between;
  padding: 0 20px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}
.top-nav h1 {
  font-size: 22px;
}
.top-nav a {
  color: white;
  margin-left: 15px;
  text-decoration: none;
}

/* ===== 侧边栏 ===== */
.sidebar {
  background-color: #2c3e50;
  color: white;
  width: 200px;
  position: fixed;
  top: 60px;
  bottom: 0;
  left: 0;
  padding: 20px;
}
.sidebar-menu {
  list-style: none;
}
.sidebar-menu li {
  margin-bottom: 10px;
}
.sidebar-menu li a {
  display: block;
  padding: 6px 10px;
  color: white;
  text-decoration: none;
  border-radius: 4px;
}
.sidebar-menu li a:hover {
  background-color: #34495e;
}
/* 二级菜单 */
.has-submenu .submenu {
  display: none;
  margin-top: 5px;
  list-style: none;
  background-color: #2c3e50;
  padding-left: 10px;
}
.has-submenu.active .submenu {
  display: block;
}

/* ===== 主体内容区域 ===== */
.main-content {
  margin-top: 60px;
  margin-left: 200px;
  padding: 20px;
  background-color: #ecf0f1;
  min-height: calc(100vh - 60px);
}

/* ===== 通用容器 ===== */
.login-container,
.change-password-container,
.modal-content {
  background-color: white;
  border: 1px solid #bdc3c7;
  border-radius: 4px;
}

/* 登录页面容器 */
.login-container {
  width: 300px;
  margin: 120px auto;
  padding: 20px;
}

/* 修改密码页面容器 */
.change-password-container {
  width: 400px;
  margin: 50px auto;
  padding: 20px;
}

/* ===== 表单及按钮通用样式 ===== */
.form-group {
  margin-bottom: 15px;
}
.form-group label {
  margin-bottom: 5px;
  display: block;
}
.form-group input[type="text"],
.form-group input[type="password"],
.form-group select {
  width: 100%;
  padding: 8px;
  border: 1px solid #bdc3c7;
  border-radius: 4px;
}
.checkbox-group {
  display: flex;
  align-items: center;
  gap: 10px;
}
.checkbox-group .inline-label {
  margin-right: 20px;
}

/* ===== 按钮基础样式 ===== */
.btn {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.btn:hover {
  opacity: 0.9;
}

.btn-primary {
  background-color: #34495e;
  color: white;
}
.btn-danger {
  background-color: #c0392b;
  color: white;
}
.btn-success {
  background-color: #27ae60;
  color: white;
}
.btn-secondary {
  background-color: #95a5a6;
  color: white;
}
.btn-sm {
  padding: 4px 8px;
  font-size: 12px;
}

/* ===== 表格样式 ===== */
.table-wrapper {
  overflow-x: auto;
  position: relative;
}

.property-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}
.property-table th,
.property-table td {
  border: 1px solid #ddd !important;
  padding: 8px;
  text-align: center;
}

/* 操作列通用样式 */
.fixed-col {
  border-left: 1px solid #ddd;
  padding: 5px 8px;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  background-color: #f9f9f9;
}

.fixed-col button {
  margin: 2px;
  font-size: 13px;
  line-height: 1;
}

/* 固定操作列 */
.property-table th.fixed-col,
.property-table td.fixed-col {
  background-color: #e8eef1; /* 浅灰色背景 */
  border-left: 1px solid #ddd;
  text-align: center;
  padding: 8px;
  min-width: 120px;
}
.property-table td.fixed-col button {
  margin: 2px;
  padding: 4px 8px;
  font-size: 14px;
}

.property-table th.fixed-col {
  z-index: 3;
}
.property-table th.fixed-col::before,
.property-table td.fixed-col::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: #bdc3c7;
  z-index: 4;
}

/* ===== 内容头部与操作区域 ===== */
.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.header-title {
  display: flex;
  align-items: center;
}
.header-actions {
  display: flex;
  align-items: center;
}
.header-actions form {
  display: flex;
  align-items: center;
  margin-right: 20px;
}
.header-actions input[type="text"] {
  padding: 6px;
  border: 1px solid #bdc3c7;
  border-radius: 4px;
}
.header-actions button {
  margin-left: 5px;
}

/* ===== 分页导航 ===== */
.pagination {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.pagination select {
  padding: 4px;
  border: 1px solid #bdc3c7;
  border-radius: 4px;
}

/* ===== 模态框 ===== */
.modal {
  display: none;
  position: fixed;
  z-index: 1100;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.4);
}
.modal-content {
  width: 400px;
  margin: 10% auto;
  padding: 20px;
  position: relative;
  background-color: white;
  border: 1px solid #bdc3c7;
  border-radius: 4px;
}
.modal .close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 28px;
  cursor: pointer;
}

/* ===== 可选列弹窗样式 ===== */
.column-modal-content {
  max-width: 400px;
  margin: 10% auto;
  padding: 20px;
  position: relative;
  border: 1px solid #bdc3c7;
  border-radius: 4px;
  background-color: white;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.column-options-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}
.column-option {
  display: inline-flex;
  align-items: center;
}
.column-option input[type="checkbox"] {
  margin-right: 8px;
}
.column-label {
  font-size: 14px;
}

/* ===== 闪现消息 ===== */
.flashes {
  color: red;
  list-style: none;
  padding: 0;
}

/* ===== 消息提示 ===== */
.message {
  text-align: center;
  font-weight: bold;
}

/* 选择列弹窗背景和整体定位 */
#columnModal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.4);  /* 半透明背景 */
}

/* 弹窗内容区域 */
#columnModal .modal-content.column-modal-content {
  background-color: #fff;
  margin: 10% auto; /* 垂直水平居中 */
  padding: 20px;
  border: 1px solid #888;
  width: 400px; /* 固定宽度，可根据需要调整 */
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* 弹窗标题 */
#columnModal .modal-content.column-modal-content h3 {
  margin-top: 0;
  font-size: 1.2em;
  text-align: center;
}

/* 选项容器，使用 flex 布局自动换行，两列显示 */
#columnModal .column-options-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;  /* 控制选项之间的间距 */
  margin-bottom: 15px;
}

/* 每个选项的容器样式 */
#columnModal .column-option {
  flex: 1 1 45%;  /* 大致两列布局 */
  display: flex;
  align-items: center;
  padding: 5px 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

/* 选项中的 label 格式 */
#columnModal .column-option label {
  display: flex;
  align-items: center;
  width: 100%;
  font-size: 14px;
  cursor: pointer;
}

/* 复选框与文字的间距 */
#columnModal .column-option input[type="checkbox"] {
  margin-right: 8px;
}

/* 弹窗按钮区域 */
#columnModal .form-group.buttons {
  text-align: right;
}

/* 针对操作列加上边框 */
.property-table td.fixed-col,
.property-table th.fixed-col {
    border: 1px solid #ddd;
    padding: 8px;
}